package com.gjs.freechat.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public abstract class AbstractBaseController {

	protected static HttpServletRequest getRequest() {
		return getServletRequestAttributes().getRequest();
	}
	
	protected static HttpServletResponse getResponse() {
		return getServletRequestAttributes().getResponse();
	}
	
	protected static ServletRequestAttributes getServletRequestAttributes() {
		return (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
	}
}
